package com.example.mqtt.device.receiver;

import com.example.mqtt.base.MqttSubTopic;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class DeviceEventReceiver extends DeviceMqttReceiver {
    @Override
    public MqttSubTopic subTopic() {
        return MqttSubTopic.EVENT;
    }

    @Override
    public void receiver(String topic, MqttMessage message) {
        log.info("接收事件消息开始，主题: " + topic + ",消息载荷: " + new String(message.getPayload()));
    }
}
